package com.cm.caseManagement.service.impl;


import com.cm.caseManagement.dao.CmAiSessionsMapper;
import com.cm.caseManagement.pojo.entity.CmAiSessions;
import com.cm.caseManagement.service.ICmAiSessionsService;
import com.cm.caseManagement.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会话Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-05
 */
@Service
public class CmAiSessionsServiceImpl implements ICmAiSessionsService
{
    @Autowired
    private CmAiSessionsMapper cmAiSessionsMapper;

    /**
     * 查询会话
     *
     * @param id 会话主键
     * @return 会话
     */
    @Override
    public CmAiSessions selectCmAiSessionsById(Long id)
    {
        return cmAiSessionsMapper.selectCmAiSessionsById(id);
    }

    /**
     * 查询会话列表
     *
     * @param cmAiSessions 会话
     * @return 会话
     */
    @Override
    public List<CmAiSessions> selectCmAiSessionsList(CmAiSessions cmAiSessions)
    {
        return cmAiSessionsMapper.selectCmAiSessionsList(cmAiSessions);
    }

    /**
     * 新增会话
     *
     * @param cmAiSessions 会话
     * @return 结果
     */
    @Override
    public int insertCmAiSessions(CmAiSessions cmAiSessions)
    {
        cmAiSessions.setCreateTime(DateUtils.getNowDate());
        return cmAiSessionsMapper.insertCmAiSessions(cmAiSessions);
    }

    /**
     * 修改会话
     *
     * @param cmAiSessions 会话
     * @return 结果
     */
    @Override
    public int updateCmAiSessions(CmAiSessions cmAiSessions)
    {
        cmAiSessions.setUpdateTime(DateUtils.getNowDate());
        return cmAiSessionsMapper.updateCmAiSessions(cmAiSessions);
    }

    /**
     * 批量删除会话
     *
     * @param ids 需要删除的会话主键
     * @return 结果
     */
    @Override
    public int deleteCmAiSessionsByIds(Long[] ids)
    {
        return cmAiSessionsMapper.deleteCmAiSessionsByIds(ids);
    }

    /**
     * 删除会话信息
     *
     * @param id 会话主键
     * @return 结果
     */
    @Override
    public int deleteCmAiSessionsById(Long id)
    {
        return cmAiSessionsMapper.deleteCmAiSessionsById(id);
    }
}
